import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    // 存储authentication
    authentication: sessionStorage.getItem('authentication') ? sessionStorage.getItem('authentication') : ''
  },
  getters: {
  },
  mutations: {
     // 修改authentication，并将authentication存入sessionStorage
     changeLogin (state, user) {
      state.authentication = user.authentication;
      sessionStorage.setItem('authentication', user.authentication);
    }

  },
  actions: {
  },
  modules: {
  }
})
